<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" href="Bootstrap/css/bootstrap.min.css">
<script src="Bootstrap/js/jquery-1.11.1.min.js"></script>
<script src="Bootstrap/js/bootstrap.min.js"></script>

<style type="text/css">
body,html {
	font-family: "微软雅黑";
	color: gray;
}

.top-title {
	height: 50px;
	background: #33CCCC;
	line-height: 50px;
	text-align: center;
	color:white;
	border-bottom: 1px solid #F2F2F2;
	font-weight: bold;
}
.form-control{
width: 100%;
margin: 0 auto;
}
input[type=button]{
background: #33CCCC;
color: white;
}
.menu-rf{
text-align: center;
}
.register-but{
float: left;
margin-left: 5%;
color: black;
}
.forget-but{
float: right;
margin-right: 5%;
color: black;
}
.bottom{
	width: 100%;
	height: 20px;
	text-align: center;
	position: fixed;
	bottom: 10px;
}

</style>
</head>
<body>
	<div class="top-title">
		<header>用户登录</header>
	</div>
	<br>
	<div style="height:50px;">
		<div style="margin: 0 auto;width:46%;"><img alt="" src="images/logo.png" style="width: 140px;" /></div>
	</div>
	<form style="width: 80%;margin: 0 auto;">
	<div class="input-group username">
	<span class="input-group-addon "><span
					class="glyphicon glyphicon-user"></span></span><input type="text" class="form-control" name="name" id="username" placeholder="请输入用户名">
					</div><br>
	<div class="input-group password">
				<span class="input-group-addon "><span
					class="glyphicon glyphicon-lock"></span></span> <input type="password" class="form-control" id="password" name="password" placeholder="请输入密码">
					</div><br>
	<input type="button" class="form-control" id="btn" onclick="login()" value="立即登录">
	<div class=menu-rf><a href="register.html" class="register-but">注册账号</a>
	<a href="" class="forget-but">忘记密码?</a></div>

	</form>
	<div class="bottom">大学生招聘APP||技术支持：zms</div>
	<script>
				function login() {
				var data = $("form").serialize();
				$.ajax({
					url:"http://localhost:8080/login",
					data:data,
					success:function (data) {
						if(data != 0){
							var user = JSON.stringify(data);
							localStorage.user = user;
							location.href="mypage.html"
						}else{
							alert("账号密码错误");
						}
					}
				})
			}
	</script>
</body>
</html>